<template>
  <div class="scene">
    <div class="cube">
      <span class="side top">{{ props.msg }}</span>
      <span class="side front">{{ props.name }}</span>
    </div>
  </div>
</template>

<script setup>
const props = defineProps({
  name: "",
  msg: ''
})
</script>

<style lang="less" scoped>
.scene {
  width: 10em;
  justify-content: center;
  align-items: center;
}

.cube {
  color: #ccc;
  cursor: pointer;
  transition: all 0.85s cubic-bezier(.17, .67, .14, .93);
  transform-style: preserve-3d;
  transform-origin: 100% 50%;
  width: 10em;
  height: 4em;
}

.cube:hover {
  transform: rotateX(-90deg);
}

.side {
  box-sizing: border-box;
  position: absolute;
  display: inline-block;
  height: 4em;
  width: 10em;
  text-align: center;
  text-transform: uppercase;
  padding-top: 1.5em;
  font-weight: bold;
}

.top {
  background: #3c3cb0;
  color: #fff;
  transform: rotateX(90deg) translate3d(0, 0, 2em);
  opacity: 0.7;
  border-radius: 10px;
}

.front {
  background: #21216f;
  color: #fff;
  transform: translate3d(0, 0, 2em);
  opacity: 0.8;
  border-radius: 15px;
}
</style>